<table id="datagrid_${action_id}" ></table>
<script type="text/javascript">
var myId ='';
<#if mine?exists>
myId = '${mine.id?default('')}';
</#if>

$(function(){

	
	$('#datagrid_${action_id}').datagrid({
		iconCls:'icon-save',
		width:'auto',
		height:'auto',
		nowrap: false,
		fit:true,
		fitColumns:true,
		striped: true,
		url:'${request.contextPath}${namespace?default('')}/mp/auth/admin-datagrid.json',
		sortName: 'name',
		sortOrder: 'desc',
		remoteSort: true,
		idField:'id',
		singleSelect:true,
		onBeforeLoad:function(){$('#datagrid_${action_id}').datagrid('unselectAll');},
		columns:[[
					//{field:'ck',checkbox:true},
					{field:'name',title:'${action.getDatagridTitle('name')}',width:80,align:'center',sortable:true},
					{field:'subName',title:'${action.getDatagridTitle('subName')}',width:80,align:'center',sortable:true},
					{field:'lastLoginTime',title:'${action.getDatagridTitle('lastLoginTime')}',width:80,align:'center',sortable:true},
					{field:'lastLoginIp',title:'${action.getDatagridTitle('lastLoginIp')}',width:80,align:'center',sortable:true},
					{field:'state',title:'${action.getDatagridTitle('state')}',width:80,align:'center',sortable:true,formatter:function(val, rec){
						<#list states as state >
						if(val== ${state.key}){
							return '${action.getDatagridTitle('state.'+state.name())}';
						}
						</#list>
					}}
				]],
		pagination:true,
		rownumbers:true,
		onDblClickRow:function(idx,data){if(typeof onDblClickRow_${action_id} != 'undefined'){onDblClickRow_${action_id}(idx,data)}},
		onClickRow:function(idx,data){if(typeof onClickRow_${action_id} != 'undefined'){onClickRow_${action_id}(idx,data)}},
		onRowContextMenu:function(e,idx,data){if(typeof onRowContextMenu_${action_id} != 'undefined'){$(this).datagrid('selectRow', idx);onRowContextMenu_${action_id}(e,idx,data)}}
	});

});

</script>	